<?php
$this->breadcrumbs=array(
	Yii::t('yii','Articles')
);

if(Yii::app()->user->hasAuth(Group::TEACHER)){
$this->menu=array(
	array('Create Article', array('create')),
	array('Manage Articles', array('admin')),
);
}
?>
<?php if(Yii::app()->user->hasAuth(Group::USER)): ?>
<div class="controll">
<?php echo Html::link('Article builder',array('post/create')); ?> | <?php echo Html::link('Your articles',array('post/mine')); ?> | <?php echo Html::link('Favourite articles',array('post/favorite')); ?> | <?php echo Html::link('Recomended articles',array('post/recomended')); ?>
</div>
<?php endif; ?>
<?php if(!empty($_GET['tag'])): ?>
<h1>Articles Tagged with <i><?php echo CHtml::encode($_GET['tag']); ?></i></h1>
<?php else: ?>
<h1><?php echo $message; ?>Articles</h1>
<?php endif; ?>

<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_view',
	'template'=>"{items}\n{pager}",
	'viewData'=>array(
	'list'=>true
	)
)); ?>

<script type="text/javascript">
$('.book_start').click(function() {
var url = "/post/program/id/"+$(this).attr('name');
var program = $(this).attr('name');
   $.get(url, function(data) {

    $("#container").append(data);

     $("#book"+program).buildContainers({
                containment:"#container",
            elementsPath:"/css/elements/"
                 });
    $("#book"+program).mb_open();
   });


});
</script>
